﻿namespace comm
{
    public interface IProtoReader
    {
        EMessageID PeekTypeHash();
        void Error(string txt, params object[] args);

        bool ReadFloat(out float outResult);
        bool ReadDouble(out double outResult);
        bool ReadUint8(out byte outResult);
        bool ReadUint16(out ushort outResult);
        bool ReadUint32(out uint outResult);
        bool ReadUint64(out ulong outResult);
        bool ReadInt8(out sbyte outResult);
        bool ReadInt16(out short outResult);
        bool ReadInt32(out int outResult);
        bool ReadInt64(out long outResult);
        bool ReadBool(out bool outResult);
        bool ReadString(out string outResult);

        bool BeginObject(string typeName, uint typeHash);
        void EndObject();

        uint StartPropsBlock();
        bool BeginProperty(out uint outNameHash);
        void EndProperty();

        int BeginArray();
        void EndArray();
    }
}
